#
#      $Id$
#
#########################################################################
#									#
#			   Copyright (C)  2002				#
#	     			Internet2				#
#			   All Rights Reserved				#
#									#
#########################################################################
#
#	File:		Makefile.am
#
#	Author:		Jeff Boote
#			Internet2
#
#	Date:		Wed Apr 17 17:53:58 EDT 2002
#
#	Description:	owping build description.

INCLUDES	= $(OWPINCS) $(I2UTILINCS)
AM_CFLAGS	= $(OWP_PREFIX_CFLAGS)

bin_PROGRAMS	= owping
owping_SOURCES	= owping.c owpingP.h
owping_LDADD	= $(OWPLIBS) $(MALLOCDEBUGLIBS) -lI2util
owping_DEPENDENCIES = $(OWPLIBDEPS) $(I2UTILLIBDEPS)
# Unfortunately, automake doesn't follow the BSD tradition here...
RM = rm -f
owping_LINKS	= owstats$(exeext) owfetch$(exeext) owup$(exeext)

owstats$(exeext): owping$(exeext)
	@if test -f $@; then $(RM) $@; fi; \
	$(LN_S) owping $@;

owfetch$(exeext): owping$(exeext)
	@if test -f $@; then $(RM) $@; fi; \
	$(LN_S) owping $@;
	
owup$(exeext): owping$(exeext)
	@if test -f $@; then $(RM) $@; fi; \
	$(LN_S) owping $@;
	
all-local: $(owping_LINKS)
CLEANFILES	= $(owping_LINKS)

#
# Someday perhaps this will be generated by automake...
#
install-exec-hook:
	@cd $(DESTDIR)$(bindir) && \
	if test -f owping; then \
	   for l in $(owping_LINKS); do \
	      if test -f $$l; then $(RM) $$l; fi; \
	      echo "$(LN_S) $(DESTDIR)$(bindir)/owping $(DESTDIR)$(bindir)/$$l"; \
	      $(LN_S) owping $$l; \
	   done; \
	fi

